package com.softserveinc.moviedbapp.application;

import android.content.SharedPreferences;

public class Settings {

	private static Settings instance;
	private SharedPreferences mPreferences;
	private Settings() {

	}

	public static Settings getInstance() {
		if (instance == null) {
			instance = new Settings();
		}
		return instance;
	}

	public boolean isSaveOnSDChecked() {
		return mPreferences.getBoolean("caching_on_sd", true);
	}

	public String getMoviesDisplayed() {

		return mPreferences.getString("limit_movie_results", "10");
	}

	public String getMoviesDisplayedWidget() {

		return mPreferences.getString("limit_movie_results_widget", "10");
	}

	public String getDefaultOrder() {
		return mPreferences.getString("order_by_preferences", "release");
	}

	public String getDefaultOrderWidget() {
		return mPreferences.getString("widget_order_by", "release");
	}

	public String getParserMode() {
		return mPreferences.getString("parsers", "xml");
	}

	public void setmPreferences(final SharedPreferences mPreferences) {
		this.mPreferences = mPreferences;
	}

}
